<template>
	<view class="content" style="margin-top: 0;">
		<u-toast ref="uToast"></u-toast>
		<u-cell-group>
			<u-cell :title="item.name" isLink v-for="item in malList" :key="item.id" @click="faultDetails(item.id)"></u-cell>
		</u-cell-group>
	</view>
</template>

<script>
	import {
		technicalList
	} from '@/api/index.js'
	export default {
		data() {
			return {
				malList: []
			}
		},
		onLoad(option) {
			this.gettechnicalList(option.cid)
		},
		onShow() {

		},
		methods: {
			faultDetails(id) {
				uni.navigateTo({
					url: '/pages/faultDetails/index?id=' + id
				});
			},
			//故障排查列表
			gettechnicalList(cid = 1) {
				technicalList({
					cid: cid
				}).then(res => {
					this.malList = res.data
				}).catch(err => {
					this.$refs.uToast.show({
						message: '暂无信息，请查看其他故障',
						type: 'default',
						icon: false,
						complete: function() {
							uni.navigateBack({
								delta: 2
							});
						}
					})
				})
			}
		}
	}
</script>

<style scoped>
	.content /deep/ .u-cell__body {
		padding: 14px;
	}
</style>

<style lang="scss" scoped>
	.content {
		background-color: #FFFFFF;
	}
</style>
